import os
from basic.config import GlobalCfg


class Workspace(object):
    def __init__(self, parent, name):
        """
        工作目录。
        parent: 父级工作目录
        name：工作目录名字
        """
        
        self.parent = parent
        
        parent_path = self.parent.path if parent is not None else GlobalCfg.workspace
        self.path = os.path.join(parent_path, name)
        
        if not os.access(self.path, os.F_OK):
            os.mkdir(self.path, 0o700)
            
            